from PyQt4 import QtGui
from deploy.gui.mainWindow import MainWindow

class Application(QtGui.QApplication):

    def __init__(self, commandLineArguments):
        super(Application, self).__init__(commandLineArguments)

        self.mainWindow = None

        self.setApplicationInfo()
        self.registerResources()

    def setApplicationInfo(self):
        '''Set some constant info for the application.'''
        # FIXME: For now, we'll just stick my personal domain info here...
        self.setOrganizationName('chphilli.net')
        self.setOrganizationDomain('chphilli.net')
        self.setApplicationName('Deployment Tool')

    def registerResources(self):
        '''Register any resources by importing the relevant files.
        
        These files must be created with the pyrcc executable that comes with
        PyQT4.
        '''
        import deploy.gui.resources.icons #@UnresolvedImport @UnusedImport


    def showMainWindow(self):
        self.mainWindow = MainWindow()
        self.mainWindow.show()

        self.mainWindow.raise_()
        self.mainWindow.activateWindow()
